<div id="center_column">
      <div class="block">
        <h4 class="vatlytrilieu">Product detail</h4>
        <div class="block_content"><!-- InstanceBeginEditable name="content" -->
      
        <div id="product-detail"> 
            <div class="gallery imgLeft illustration">
                <?php if(!empty($this->prod->thumb)){?>
                <img width="200" src="<?=$this->baseUrl("images/product/thumb/{$this->prod->thumb}")?>" alt="<?=$this->prod->name?>" />
                <?php }?>
            </div>              
            <h3><?=$this->prod->name?></h3>
            <p><strong>Item code:</strong><?=$this->prod->code?></p> 
            <p><strong>Brand:</strong> <a href="#"><?=$this->brand?></a></p>
            <p><strong>Category</strong>:<a href="#"><?=$this->cat_name?></a></p>
            <p><strong>Price</strong>: <span style="color: red; font-size: 20px; font-weight: bold;">$<?=number_format($this->prod->price,2,".","")?></span></p>
            <p><strong>Rating</strong>:
                <?php
                    //show rating 
                    for($i=0;$i<5;$i++)
                    {
                        if($i<$this->nstart)
                            $ico = $this->baseUrl("templates/default/images/star_list.png");
                        else
                            $ico = $this->baseUrl("templates/default/images/star_unlist.png");
                        echo "<img src='$ico'/>";
                    }
                ?>
            </p>
        </div>
        <script>
        $(function(){
            
            $(".dathang a").click(function(){
                var link = $(this).attr("href");
                
                $.get(link, {"qty":$(".quantity").val()}, function(rdata){
                    $(".giohang a").html("<span style='color:#000;'>" + rdata + "</span>" + " item");
                    $(".dialog-cart").html($("#product-detail").html()).dialog({
                        autoOpen: true,
                        modal: true,
                        width: 550,
                        title: "Add to your cart",
                        buttons: {
                            "View Cart": function(){
                               window.location = "<?=$this->baseUrl("cart/")?>";
                            },
                            "No Thanks": function(){
                                $(this).dialog("close");
                            }
                        }
                    });
                },"json");
                
                return false;
            })
            
        })
        </script>
        <div class="dialog-cart" title="" style="display: none;"></div>
        <div class="dathang floatleft">
            <a href="<?=$this->baseUrl("cart/add/{$this->prod->id}-{$this->prod->alias}.html")?>">
                <img width="30" height="30" src="<?=$this->baseUrl("templates/default/")?>/images/shopping_cart_add.png" />
                Add to cart
            </a>
        </div>        
        <div class="floatleft" style="margin: 25px 0px 0px 10px;">
            <strong>Quantity</strong>:<input type="text" name="quantity" class="quantity" value="1" size="3" style="height: 20px; text-align: center; margin-left: 10px;" />
        </div>
         <div class="clearb">&nbsp;</div>
         <fieldset class="fs">
            <legend class="lg">Description</legend>
            <?=$this->prod->description?>
         </fieldset>
 <div class="clearb">&nbsp;</div>  
 <div style="display:inline-block;width:530px;margin:5px;position:relative">
			    <a class="icon-view-comment" href="javascript:showListComment()"></a>
			    <a class="icon-send-comment" href="javascript:showSendComment()"></a>
		    </div>
        
        <div class="listcomment" id="listcomment">
    <div id="divComment">
    
   <div id="xemykien">
        <ul style="margin:0;padding:0;left:0" class="comment-list">
            
            <?php $stt=0; foreach($this->comments as $comment){ $parity = ($stt%2)?"style='background-color:#F0F0F0'":"";?>
            <li <?=$parity?> class="item-cm">
                <div style="padding-left:10px" class="item-cm-bg">
        	        <div style="color:#000" class="name-email"><?=$comment->fullname?></div>
        	        <div style="color:#666666" class="comment_content">
                    <?php
                    $date = new Zend_Date($comment->comdate);
                    echo $date->toString("dd/MM/YYYY");
                    ?>
                    </div>
                    <p style="color:#000" class="comment_content"><?=$comment->content?></p>
                </div>
            </li>
            <?php $stt++;}?>    	
        </ul>

    </div>
    
    <div id="guiykien" style="display:none;">
        
<ul style="margin:0;padding:0;left:0" class="comment-list">

<div class="box-form-order" style="margin-top:10px;">
            <div class="box-curved">
              <form onsubmit="" class="form" name="fOrder" id="fOrder" action="" method="post">
                  <input type="hidden" value="<?=$this->prod->id?>" name="idproduct" />
                  <div class="item">
                    <label for="rating">Rating</label>
                    <script>
                    $(function(){
                        $(".rating a").click(function(){
                            var rate = $(this).attr("rel");
                            var value = $(".rating input").val();
                            if(rate==1)
                            {
                                $(this).attr("rel",0);
                                $(".rating input").val(parseInt(value)-1);
                                $(this).children("img").attr("src","<?=$this->baseUrl("templates/default/images/star_unlist.png")?>");
                            }
                            else
                            {
                                 $(this).attr("rel",1);
                                 $(".rating input").val(parseInt(value)+1);
                                 $(this).children("img").attr("src","<?=$this->baseUrl("templates/default/images/star_list.png")?>");
                            }                            
                            return false;
                        })
                    })
                    </script>
                    <div class="input rating">
                        <a href="#" rel="0"><img src="<?=$this->baseUrl("templates/default/")?>/images/star_unlist.png"/></a>
                        <a href="#" rel="0"><img src="<?=$this->baseUrl("templates/default/")?>/images/star_unlist.png"/></a>
                        <a href="#" rel="0"><img src="<?=$this->baseUrl("templates/default/")?>/images/star_unlist.png"/></a>
                        <a href="#" rel="0"><img src="<?=$this->baseUrl("templates/default/")?>/images/star_unlist.png"/></a>
                        <a href="#" rel="0"><img src="<?=$this->baseUrl("templates/default/")?>/images/star_unlist.png"/></a>
                        <input type="hidden" name="rating" value="0" />
                    </div>
                  </div>
                  
                  <div class="item">                  
                  <label for="name">Name <span class="font_err"><em>(Required)</em></span></label>
                  <div class="input">
                        <input type="text" id="name" name="name" class="textfiled text_100" value="" />
                  </div>
                  </div>                    
                  <div class="item">
                    <label for="email">Email <span class="font_err"><em>(Required)</em></span></label>
                    <div class="input">
                         <input type="text" id="email" name="email" class="textfiled text_100" value="" />
                     </div>
                  </div>
                      
                <div class="item">
                <label for="phone">Title </label>
                <div class="input">
                    <input type="text" id="phone" name="title" class="textfiled text_100" value="" />
                </div>
                </div>
                  <div class="item">
                    <label for="content">Content <span class="font_err"><em>(Required)</em></span></label>
                    <div class="input">
                      <textarea id="yeucau" name="content" class="textarea2" rows="7"></textarea>
                    </div>
                </div>                   
                <div class="clear"></div>
                <div align="center" class="btn">
                  <input type="submit" class="button" value=" Submit " name="do_submit" />
                  &nbsp;&nbsp;
                  <input type="reset" class="button" value=" Reset " name="reset" />
                  &nbsp;&nbsp; </div>
              </form>
            </div>
            <div class="clear"></div>
            </div>
    	
</ul>

    </div>
    

</div>
    <div class="paging comment_pageing" id="divPaging" style="display: none;"><a class="active" href="#sendbl">1</a>&nbsp;</div>    

</div>
        
 <div class="clearb">&nbsp;</div>    
        <!-- InstanceEndEditable --></div>
      </div>
      
      
    </div>
    
 <script type="text/javascript">

function showListComment()
{
    document.getElementById("guiykien").style.display = "none";
    if(document.getElementById("xemykien")!=null) document.getElementById("xemykien").style.display = "";
}
function showSendComment()
{
    if(document.getElementById("xemykien")!=null) document.getElementById("xemykien").style.display = "none";
    document.getElementById("guiykien").style.display = "";
}
</script>